package org.example.demo21.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.example.demo21.entity.dto.DemoDTO;
import org.example.demo21.service.RabbitService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author guocong
 * @since 2024/3/11 15:33
 */

@RestController
@Tag(name = "mq延时队列demo")
@RequestMapping("/rabbit")
public class RabbitController {

    @Resource
    private RabbitService rabbitService;


    @Operation(summary = "缓存", description = "缓存", method = "POST")
    @PostMapping(value = "/delay")
    public Boolean delay(@RequestBody DemoDTO dto) {
        return rabbitService.delaySend(dto);
    }


}
